<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>订单明细 - TMS</title>
    <link rel="stylesheet" href="/view/frame/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/view/frame/static/css/global.css?v=1.0">
    <link rel="stylesheet" href="/view/tms/static/css/add.css?v=1.0">
    <style>
      body {margin:0px;}
      /* .layui-form-label {width:120px;}
      .layui-input-inline {padding-top: 10px;} */
      span{height: 36px;line-height:36px}
      .wrList {padding: 0 17px;}
      .layui-form-item {
        margin-bottom: 0;
      }
    </style>
  </head>
  <body>
    <form class="layui-form" autocomplete="off">
      <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
        <legend>订单信息</legend>
      </fieldset>
      <div class="layui-fluid">
        <div class="layui-row">
            <div class="layui-col-sm4">
                <label class="layui-form-label">运输作业号</label>
                <div class="layui-input-block">
                    <span id="jobNo" name="jobNo"></span>
                </div>
            </div>
            <div class="layui-col-sm4">
                <label class="layui-form-label">客户</label>
                <div class="layui-input-block">
                    <span id="customerName" name="customerName"></span>
                </div>
            </div>
            <div class="layui-col-sm4">
                <label class="layui-form-label">装卸地</label>
                <div class="layui-input-block">
                    <span id="address" name="address"></span>
                </div>
            </div>
        </div>
        <div class="layui-row">
            <div class="layui-col-sm4">
                <label class="layui-form-label">S/O</label>
                <div class="layui-input-block">
                    <span id="soNumber" name="soNumber"></span>
                </div>
            </div>
            <div class="layui-col-sm4">
                <label class="layui-form-label">司机所属公司</label>
                <div class="layui-input-block">
                    <span id="driverCompany" name="driverCompany"></span>
                </div>
            </div>
            <div class="layui-col-sm4">
                <label class="layui-form-label">司机</label>
                <div class="layui-input-block">
                    <span id="driverName" name="driverName"></span>
                </div>
            </div>
        </div>
        <div class="layui-row">
            <div class="layui-col-sm4">
                <label class="layui-form-label">拖车车牌</label>
                <div class="layui-input-block">
                    <span id="carNo" name="carNo"></span>
                </div>
            </div>
            <div class="layui-col-sm4">
                <label class="layui-form-label">箱号/箱型</label>
                <div class="layui-input-block">
                    <span id="arkNo" name="arkNo"></span>/
                    <span id="arkType" name="arkType"></span>
                </div>
            </div>
            <div class="layui-col-sm4">
                <label class="layui-form-label">做柜日期</label>
                <div class="layui-input-block">
                    <span id="doarkDate" name="doarkDate"></span>
                </div>
            </div>
        </div>
        <div class="layui-row">
            <div class="layui-col-sm4">
                <label class="layui-form-label">运费限价</label>
                <div class="layui-input-block">
                    <span id="freightPrice" name="freightPrice"></span>
                </div>
            </div>
            <div class="layui-col-sm4">
                <label class="layui-form-label">审核状态</label>
                <div class="layui-input-block">
                    <span id="auditStatus" name="auditStatus"></span>
                </div>
            </div>
            <div class="layui-col-sm4">
                <label class="layui-form-label">核销状态</label>
                <div class="layui-input-block">
                    <span id="confirmStatus" name="confirmStatus"></span>
                </div>
            </div>
        </div>
        <div class="layui-row">
            <div class="layui-col-sm12">
                <label class="layui-form-label">审核备注</label>
                <div class="layui-input-block">
                    <span id="auditRemarks" name="auditRemarks"></span>
                </div>
            </div>
        </div>
      </div>
      <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
        <legend>应收费用</legend>
      </fieldset>

     
    <!--start:表格列表-->
    <div class="wrList layui-row">
      <div class="layui-col-md3 item-1">
        <table class="layui-table">
          <thead>
            <tr>
              <th>序号</th>
              <th>费用</th>
              <th>金额</th>
            </tr>
          </thead>
          <tbody></tbody>
        </table>
      </div>
      <div class="layui-col-md3 item-2">
        <table class="layui-table">
          <thead>
            <tr>
              <th>序号</th>
              <th>费用</th>
              <th>金额</th>
            </tr>
          </thead>
          <tbody></tbody>
        </table>
      </div>
      <div class="layui-col-md3 item-3">
        <table class="layui-table">
          <thead>
            <tr>
              <th>序号</th>
              <th>费用</th>
              <th>金额</th>
            </tr>
          </thead>
          <tbody></tbody>
        </table>
      </div>
      <div class="layui-col-md3 item-4">
        <table class="layui-table">
          <thead>
            <tr>
              <th>序号</th>
              <th>费用</th>
              <th>金额</th>
            </tr>
          </thead>
          <tbody></tbody>
        </table>
      </div>
    </div>
    <!--end:表格列表-->
    <div class="layui-row">
      <div class="layui-col-sm4">
        <label class="layui-form-label">类型</label>
          <div class="layui-input-block">
            <span id="receivedType" name="receivedType"></span>
          </div>
      </div>
      <div class="layui-col-sm8">
        <label class="layui-form-label">应收备注</label>
          <div class="layui-input-block">
            <span id="receivedRemarks" name="receivedRemarks"></span>
          </div>
      </div>
    </div>
  </body>
  <script charset="utf-8" src="/view/frame/layui/layui.js"></script>
  <script charset="utf-8" src="/view/frame/static/js/jquery.min.js?v=1.0"></script>
  <script charset="utf-8" src="/view/frame/static/js/layui.district.js?v=1.0"></script>
  <script charset="utf-8" src="/view/tms/static/js/tms_tab.js?v=1.0"></script>
  <script charset="utf-8" src="/view/tms/static/js/tms_index.js?v=1219"></script>
  <script charset="utf-8" src="/view/frame/static/js/lang_zh_CN.js?v=1.0"></script>
  
  <script charset="utf-8" src="/view/frame/static/js/errorCodeMap.js"></script>
  <script charset="utf-8" src="/view/frame/static/js/HC.js?v=1.4"></script>
  <script charset="utf-8" src="/view/tms/static/js/validator.js"></script>
  <script charset="utf-8" src="/view/tms/static/js/bizUtil.js"></script>
  
  <script>
  layui.use(['form', 'layer', 'table', 'laydate'], function(){
    var form = layui.form,
        layer = layui.layer,
        table = layui.table,
        laydate = layui.laydate,
        tmsTab = layui.tms_tab,
        $ = layui.jquery;

        var $jobNo = $.trim(getUrlParam('jobNo'));
        roleStatu($jobNo);
            //渲染页面
      function roleStatu($id){
        var $saveData = {
          jobNo: $id,
        }
        // console.log(JSON.stringify($saveData));
        $.ajax({
          type:'POST', 
          url:'/ucenter/general/finance/receivedBills/searchReturnDetail.shtml', 
          dataType:"json",
          contentType: "application/json",
          data:JSON.stringify($saveData),
          success:function(d){
            var $code = d.code,
                $msg = d.msg,
                $objects = d.objects;
            if($code === 'SUCCESS'){
                $('span[name="jobNo"]').html($objects.receiptResult.jobNo);
                $('span[name="customerName"]').html($objects.receiptResult.customerName);
                $('span[name="address"]').html($objects.receiptResult.address);
                $('span[name="soNumber"]').html($objects.receiptResult.soNumber);
                $('span[name="arkType"]').html($objects.receiptResult.arkType);
                $('span[name="driverName"]').html($objects.receiptResult.driverName);
                $('span[name="carNo"]').html($objects.receiptResult.carNo);
                $('span[name="arkNo"]').html($objects.receiptResult.arkNo);
                $('span[name="doarkDate"]').html($objects.myReceiptResult.doarkDate);
                $('span[name="auditStatus"]').html($objects.myReceiptResult.auditStatus);
                $('span[name="confirmStatus"]').html($objects.myReceiptResult.confirmStatus);
                $('span[name="auditRemarks"]').html($objects.myReceiptResult.auditRemarks);
                $('span[name="driverCompany"]').html($objects.myReceiptResult.driverCompany);
                $('span[name="receivedType"]').html($objects.myReceiptResult.receivedType);
                $('span[name="receivedRemarks"]').html($objects.myReceiptResult.receivedRemarks);
          for(var i = 0; i < $objects.receiptResult.wrList.length; i++){
            console.log($objects.receiptResult.wrList[i].recostAmount);
            if(i % 4 == 0){
              $(".wrList .item-1 tbody").append("<tr><td>" + (i + 1) + "</td><td>" + $objects.receiptResult.wrList[i].recostName + "</td><td>" + $objects.receiptResult.wrList[i].recostAmount + "</td></tr>");
            }else if(i % 4 == 1){
              $(".wrList .item-2 tbody").append("<tr><td>" + (i + 1) + "</td><td>" + $objects.receiptResult.wrList[i].recostName + "</td><td>" + $objects.receiptResult.wrList[i].recostAmount + "</td></tr>");
            }else if(i % 4 == 2){
              $(".wrList .item-3 tbody").append("<tr><td>" + (i + 1) + "</td><td>" + $objects.receiptResult.wrList[i].recostName + "</td><td>" + $objects.receiptResult.wrList[i].recostAmount + "</td></tr>");
            }else if(i % 4 == 3){
              $(".wrList .item-4 tbody").append("<tr><td>" + (i + 1) + "</td><td>" + $objects.receiptResult.wrList[i].recostName + "</td><td>" + $objects.receiptResult.wrList[i].recostAmount + "</td></tr>");
            }
          }
            }else{
              parent.layer.closeAll();
              parent.layer.alert('查询失败！');
            }
          }
        });
      }
  });
  </script>
</html>